package jee.boot.module.crud.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import jee.boot.common.annotation.Column;
import jee.boot.common.basic.DataEntity;
import jee.boot.common.utils.excel.annotation.ExcelField;
import jee.boot.entity.system.Area;

import java.util.Date;

/**
 * 示例-单表操作Entity
 *
 * @author
 * @version 2019-06-19
 */
@ApiModel(description = "示例-单表操作")
public class DemoCrud extends DataEntity<DemoCrud> {

    private static final long serialVersionUID = 1L;
    /**
     * 字典翻译字典示例
     */
    @ExcelField(dictType = "data_status", sort = 10)
    private String userStatus;        // 数据状态
    /**
     * 时间类型字典示例
     */
    @ExcelField(sort = 20)
    private Date userTime;//时间
    /**
     * 文本字段示例
     */
    @ExcelField(sort = 30)
    private String name;
    /**
     * 主数据翻译字段示例
     */
    @ExcelField(sort=40,attrName = "area.name")
    @Column(data = {"area.id","area.name"})
    private Area area;

    /**
     * 主数据翻译字段示例(基于缓存)
     */
    @ExcelField(sort=50)
    private String areaCode;

    public DemoCrud() {
        super();
    }

    public DemoCrud(String id) {
        super(id);
    }


    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    public Date getUserTime() {
        return userTime;
    }

    public void setUserTime(Date userTime) {
        this.userTime = userTime;
    }




    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserStatus() {
        return userStatus;
    }

    public void setUserStatus(String userStatus) {
        this.userStatus = userStatus;
    }

    public Area getArea() {
        return area;
    }

    public void setArea(Area area) {
        this.area = area;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }
}